namespace JGSY.CMS.LowCode.Platform.Application.DTOs
{
    /// <summary>
    /// 用户数据传输对象
    /// 用于传输用户基本信息和状态数据
    /// </summary>
    public class UserDto
    {
        /// <summary>
        /// 用户标识
        /// 用户的唯一标识符
        /// </summary>
        public long Id { get; set; }
        
        /// <summary>
        /// 用户名
        /// 用户的登录用户名
        /// </summary>
        public string Username { get; set; } = string.Empty;

        /// <summary>
        /// 用户名（兼容性属性）
        /// </summary>
        public string UserName 
        {
            get => Username;
            set => Username = value;
        }

        /// <summary>
        /// 姓
        /// </summary>
        public string? FirstName { get; set; }

        /// <summary>
        /// 名
        /// </summary>
        public string? LastName { get; set; }

        /// <summary>
        /// 显示名称
        /// </summary>
        public string? DisplayName { get; set; }
        
        /// <summary>
        /// 电子邮箱
        /// 用户的电子邮箱地址
        /// </summary>
        public string Email { get; set; } = string.Empty;

        /// <summary>
        /// 密码（仅用于创建和更新操作）
        /// </summary>
        public string? Password { get; set; }
        
        /// <summary>
        /// 手机号码
        /// 用户的手机号码
        /// </summary>
        public string? Phone { get; set; }

        /// <summary>
        /// 头像URL
        /// </summary>
        public string? Avatar { get; set; }

        /// <summary>
        /// 真实姓名
        /// </summary>
        public string? RealName { get; set; }

        /// <summary>
        /// 用户状态（1-正常，0-禁用）
        /// </summary>
        public int Status { get; set; } = 1;

        /// <summary>
        /// 最后登录时间
        /// </summary>
        public DateTime? LastLoginTime { get; set; }

        /// <summary>
        /// 部门ID
        /// </summary>
        public long? DepartmentId { get; set; }

        /// <summary>
        /// 是否激活
        /// </summary>
        public bool IsActive { get; set; } = true;

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreatedAt { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime UpdatedAt { get; set; }

        /// <summary>
        /// 用户角色
        /// </summary>
        public List<string>? Roles { get; set; }
    }
}
